-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IN_CLOSE_WRITE Event #93
Conversation
Thank you for your patch. |
ok! |
@xieke91 Do you know that you can update your pull requests, you don't have to close them and open new ones. And if you want to have a nice looking git log, you can use git rebase to rewrite your local history and use |
sorry,I am not very familiar with git and I'm already update it with CLOSE_WRITE. |
I try to edit tests but something wrong in windows and macos,maybe you can do it. |
I don't think that the test that's failing in travis build nr. 215.1 has anything to do with your patch. I'll have a look at that. |
Yep, looks good. I think kqueue (BSD's inotify) may support an analog to IN_CLOSE_WRITE, so it may not be a linux-only thing in the long term. @Hessijames I'll have a closer look (finally! it's been a busy few weeks) at debounce, but do you think CLOSE_WRITE could be integrated somehow? Like, can we have some way of using CLOSE_WRITE on linux and a debounced MODIFY on other platforms to watch for "a file has been modified"? Just thinking out loud, it's probably infeasible, hah. |
I thought about that as well, but in the end I think it would only complicate things. The debounce module debounces more than just write events (eg. "safe saves"), so using CLOSE_WRITE would introduce inconsistencies not only across platforms but also across events. |
That makes sense 👍 |
The IN_MODIFY event is emitted on a file content change (e.g. via the write() syscall) while IN_CLOSE_WRITE occurs on closing the changed file. It means each change operation causes one IN_MODIFY event (it may occur many times during manipulations with an open file) whereas IN_CLOSE_WRITE is emitted only once (on closing the file).